﻿using BCEntity.OA.BusinessFlowRecord;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace BCData.OA.BusinessFlowRecord
{
    /// <summary>
    /// OA系统业务流记录
    /// </summary>
	public interface IBusinessFlowRecordData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="businessFlowRecordId">OA系统业务流记录Id</param>
        Task<bool> Exists(long businessFlowRecordId);
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="businessFlowModelCode">OA系统业务流模型编码</param>
        /// <param name="referenceNo">引用编码</param>
        Task<bool> Exists(string businessFlowModelCode,string referenceNo);
        /// <summary>
        /// 增加OA系统业务流记录
        /// </summary>
        /// <param name="entity">OA系统业务流记录信息</param>
        Task<BusinessFlowRecordEntity> Add(BusinessFlowRecordEntity entity);
        /// <summary>
        /// 更新OA系统业务流记录
        /// </summary>
        /// <param name="entity">OA系统业务流记录信息</param>
        Task<BusinessFlowRecordEntity> Update(BusinessFlowRecordEntity entity);
        /// <summary>
        /// 删除OA系统业务流记录
        /// </summary>
        /// <param name="businessFlowRecordId">OA系统业务流记录Id</param>
        Task<bool> Delete(long businessFlowRecordId);
        /// <summary>
        /// 获取OA系统业务流记录
        /// </summary>
        /// <param name="businessFlowRecordId">OA系统业务流记录Id</param>
        Task<BusinessFlowRecordEntity> GetEntity(long businessFlowRecordId);
        /// <summary>
        /// 获取OA系统业务流记录
        /// </summary>
        /// <param name="businessFlowModelCode">业务流模型编码</param>
        /// <param name="referenceNo">引用编号</param>
        /// <returns></returns>
        Task<BusinessFlowRecordEntity> GetEntity(string businessFlowModelCode, string referenceNo);
        /// <summary>
        /// 获取OA系统业务流记录列表
        /// </summary>
        Task<IEnumerable<BusinessFlowRecordEntity>> GetList();
        /// <summary>
        /// 获取OA系统业务流记录分页列表
        /// </summary>
        /// <param name="businessFlowModelCode">业务流模型编码</param>
        /// <param name="referenceNo">引用编号</param>
        /// <param name="isInitialized">已初始化完成的</param>
        /// <param name="isInitFailed">初始化失败的</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">OA系统业务流记录每页数据条数</param>
        Task<(IEnumerable<BusinessFlowRecordEntity>, int)> Query(string businessFlowModelCode,string referenceNo, bool? isInitialized, bool? isInitFailed, DateTime? start, DateTime? end, int pageIndex, int pageSize);
        #endregion  成员方法
    }
}
